<template>
  <div class="public-activities">
    <h2>公开活动列表</h2>
    <ul class="activity-list">
      <li v-for="activity in activities" :key="activity.id" class="activity-item">
        <router-link :to="{ name: 'public-activity-detail', params: { id: activity.id } }">
          <h3>{{ activity.title }}</h3>
          <p>{{ activity.date }} - {{ activity.location }}</p>
        </router-link>
      </li>
    </ul>
  </div>
</template>

<script>
import activities from '@/assets/activities.json';

export default {
  data() {
    return {
      activities
    };
  }
}
</script>

<style scoped>
.public-activities {
  max-width: 800px;
  margin: 2rem auto;
  padding: 1rem;
}

.activity-list {
  list-style: none;
  padding: 0;
}

.activity-item {
  background-color: #f9f9f9;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 1rem;
  padding: 1rem;
  transition: transform 0.3s, box-shadow 0.3s;
}

.activity-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.activity-item a {
  text-decoration: none;
  color: #333;
}

.activity-item h3 {
  margin-top: 0;
  color: #42b983;
}

.activity-item p {
  margin-bottom: 0;
  color: #666;
}
</style>